// AttachMatrixFunctionReader.cpp: implementation of the AttachMatrixFunctionReader class.
//
//////////////////////////////////////////////////////////////////////

#include "stdafx.h"
#include "AttachMatrixFunctionReader.h"
#include "AttachMatrixFunction.h"
//////////////////////////////////////////////////////////////////////
// Construction/Destruction
//////////////////////////////////////////////////////////////////////

IMPLEMENT_DYNAMIC_CREATE(AttachMatrixFunctionReader, PartDBReader, FunctionObject::eJONTATTACHMATRIX);

AttachMatrixFunctionReader::AttachMatrixFunctionReader()
{

}

AttachMatrixFunctionReader::~AttachMatrixFunctionReader()
{

}

FunctionObject* AttachMatrixFunctionReader::Reader(const _RecordsetPtr& rs)
{
	FunctionObject* pObject = PartDBReader::CreateObject(rs);
	ASSERT(pObject);

	ASSERT(pObject->IsKindOf(RUNTIME_CLASS_EX(AttachMatrixFunction)));
	AttachMatrixFunction* pFun = static_cast<AttachMatrixFunction*>(pObject);

	CString strTemp;
	strTemp = GetString(1, rs);
	ASSERT(!strTemp.IsEmpty());
	pFun->PartID(strTemp);
	
	strTemp = GetString(2, rs);
	ASSERT(!strTemp.IsEmpty());
	pFun->BasePointFormer(strTemp);
	
	strTemp = GetString(3, rs);
	ASSERT(!strTemp.IsEmpty());
	pFun->vXFormer(strTemp);

	strTemp = GetString(4, rs);
	ASSERT(!strTemp.IsEmpty());
	pFun->vZFormer(strTemp);

	return pFun;
}